package DAL;
/**hofit**/
import java.util.ArrayList;

public class Item_DAL {
	/**
	 * 
	 * @param arrItem
	 * Constructor
	 */
		public Item_DAL(ArrayList<String> arrItem) {
		super();
		this.itemID = Integer.parseInt(arrItem.get(0));
		this.itemNmae = arrItem.get(1);
		this.numOfCopies = Integer.parseInt(arrItem.get(2));
		this.edition = arrItem.get(3);
		this.wanted = Integer.parseInt(arrItem.get(4));
		this.description = arrItem.get(5);
		this.location = arrItem.get(6);
		NumOfAviliable = Integer.parseInt(arrItem.get(7));
		NumofOrdered = Integer.parseInt(arrItem.get(8));
	}

	private int itemID;
	private String itemNmae;
	private int numOfCopies;
	private String edition;
	private int wanted;
	private String description;
	private String location;
	private int NumOfAviliable;
	private int NumofOrdered;
	//private blob xxx;
	
	/**
	 * 
	 * @return get itemID
	 */
	public int getItemID() {
		return itemID;
	}
	/**
	 * 
	 * @param itemID
	 * set itemID
	 */
	public void setItemID(int itemID) {
		this.itemID = itemID;
	}
	/**
	 * 
	 * @return get item name
	 */
	public String getItemNmae() {
		return itemNmae;
	}
	/**
	 * 
	 * @param itemNmae
	 * set item name
	 */
	public void setItemNmae(String itemNmae) {
		this.itemNmae = itemNmae;
	}
	/**
	 * 
	 * @return get num of copies
	 */
	public int getNumOfCopies() {
		return numOfCopies;
	}
	/**
	 * 
	 * @param numOfCopies
	 *  set num of copies
	 */
	public void setNumOfCopies(int numOfCopies) {
		this.numOfCopies = numOfCopies;
	}
	/**
	 * 
	 * @return get edition
	 */
	public String getEdition() {
		return edition;
	}
	/**
	 * 
	 * @param edition
	 * set edition
	 */
	public void setEdition(String edition) {
		this.edition = edition;
	}
	/**
	 * 
	 * @return get Wanted
	 */
	public int getWanted() {
		return wanted;
	}
	/**
	 * 
	 * @param wanted
	 * set Wanted
	 */
	public void setWanted(int wanted) {
		this.wanted = wanted;
	}
	/**
	 * 
	 * @return get description
	 */
	public String getDescription() {
		return description;
	}
	/**
	 * 
	 * @param description
	 * set description
	 */
	public void setDescription(String description) {
		this.description = description;
	}
	/**
	 * 
	 * @return get location
	 */
	public String getLocation() {
		return location;
	}
	/**
	 * 
	 * @param location
	 *  set location
	 */
	public void setLocation(String location) {
		this.location = location;
	}
	/**
	 * 
	 * @return get Num Of Aviliable
	 */
	public int getNumOfAviliable() {
		return NumOfAviliable;
	}
	/**
	 * 
	 * @param numOfAviliable
	 *  set Num Of Aviliable
	 */
	public void setNumOfAviliable(int numOfAviliable) {
		NumOfAviliable = numOfAviliable;
	}
	/**
	 * 
	 * @return get Num of Ordered
	 */
	public int getNumofOrdered() {
		return NumofOrdered;
	}
	/**
	 * 
	 * @param numofOrdered
	 *  set Num of Ordered
	 */
	public void setNumofOrdered(int numofOrdered) {
		NumofOrdered = numofOrdered;
	}
	
	/**
	 * 
	 * @param item - item
	 * @return  array list
	 * convert Item class to array list
	 */
	public ArrayList<String> itemToArray(Item_DAL item)
	{
		ArrayList<String> arrItem = new ArrayList<String>();
		arrItem.add(Integer.toString(item.itemID));
		arrItem.add(item.itemNmae);
		arrItem.add(Integer.toString(item.numOfCopies));
		arrItem.add(item.edition);
		arrItem.add(Integer.toString(item.wanted));
		arrItem.add(item.description);
		arrItem.add(item.location);
		arrItem.add(Integer.toString(item.NumOfAviliable));
		arrItem.add(Integer.toString(item.NumofOrdered));
		//arrItem.add(item.xxx));
		
		return arrItem;
	}


}
